#ifndef __LOOKUPUTILS_H
#define __LOOKUPUTILS_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <sys/fcntl.h>

#include <netdb.h>
#define __GNU_SOURCE

#define BUFFERSIZE      256

void error_msg (const char *msg);
void info (const char *msg);

int create_socket (sa_family_t type);
int create_tcp_socket ();

int create_tcp_server_socket (char *port, int qlen);
void bind_and_listen (int fd, in_port_t port, int qlen);

void connect_to_tcp_server(int fd, char *server, char *port);

int make_socket_nonblocking(int fd);

#endif
